package com.limf.demo.arithmetic;

import java.util.Arrays;

public class SortTest1 {
	public static void main(String[] args) {
		int[] nums1 = new int[] {1, 2, 4, 6, 7, 123, 411, 5334, 1414141, 1314141414};
		int[] nums2 = new int[] {0, 2, 5, 7, 89, 113, 5623, 6353, 134134};
		int[] nums3 = new int[nums1.length+nums2.length];
		//int len = (nums1.length > nums2.length ? nums1.length :nums2.length);
		
		int j=0;  // nums2的index
		int nums3_i = 0;  // nums3的index
		label1:for(int i=0;i<nums1.length;i++) {
			
			
			label2:for(;j<nums2.length;j++) {
				if(nums1[i] <= nums2[j]) {
					nums3[nums3_i++] = nums1[i];
					continue label1;
				}else {
					nums3[nums3_i++] = nums2[j];
				}
			}
			if(j == nums2.length) {
				nums3[nums3_i++] = nums1[i];
			}
		}
		System.out.println(Arrays.toString(nums3));
		
	}

}
